package com.ds.lens.data.common.constant;

public enum CompareOperatorEnum {
    EQUAL("==", 0),
    LARGERTHAN(">", 1),
    LESSTHANOREQUAL(">=", 2),
    LESSTHAN("<", 3),
    LEARGERTHANOREQUAL("<=", 4),
    NOT_EQUAL("!=", 5);

    private String operator;
    private int value;

    CompareOperatorEnum(String operator, int value) {
        this.operator = operator;
        this.value = value;
    }

    public static CompareOperatorEnum valueOf(Integer value) {
        if (value == null) {
            return null;
        }
        for (CompareOperatorEnum aggrEnum : CompareOperatorEnum.values()) {
            if (aggrEnum.value == value) {
                return aggrEnum;
            }
        }
        return null;
    }

    public String getOperator() {
        return operator;
    }
}
